import { Login } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import { obj2fd } from "@/utils/index";
import http from "@/api";
// 查询列表
export const getDataByPage = (params: object) => {
  return http.post(PORT1 + `/secure/dnsList/${params.pageNum}/${params.pageSize}`); // 正常 post json 请求  ==>  application/json
};
// 查询访问哨兵配置
export const ifaceGlobalList = (params: object) => {
  return http.get(PORT1 + `/secure/ifaceGlobalList`); // 正常 post json 请求  ==>  application/json
};
// 设置访问哨兵配置
export const ifaceGlobalSet = (params: object) => {
  return http.post(PORT1 + `/secure/ifaceGlobalSet`, params); // 正常 post json 请求  ==>  application/json
};
// 获取访问伪装服务
export const l7srvcfgRuleGet = (params: object) => {
  return http.get(PORT1 + `/secure/srvcfgRuleGet`); // 正常 post json 请求  ==>  application/json
};
// 设置访问伪装服务
export const l7srvcfgRuleSet = (params: object) => {
  return http.post(PORT1 + `/secure/srvcfgRuleSet`, obj2fd(params)); // 正常 post json 请求  ==>  application/json
};
// 获取标签列表
export const blockTab = () => {
  return http.get(PORT1 + `/secure/blockTab`); // 正常 post json 请求  ==>  application/json
};
// 获取标策略列表
export const getBlocks = params => {
  return http.get(PORT1 + `/secure/blockList`, params, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 获取阻断策略数据
export const getDataById = id => {
  return http.get(PORT1 + `/secure/blockEdit/${id}`, {}, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 设置阻断策略数据
export const editData = params => {
  return http.post(PORT1 + `/secure/blockUpdate`, params, { loading: false }); // 正常 post json 请求  ==>  application/json
};
